package entity

import (
	"time"

	"shqsoft.cn/pasnj/base"

	"github.com/jinzhu/gorm"
)

//BWYWJZZB 国际结算量导入
type BWYWJZZB struct {
	ID   int       `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	DRRQ time.Time `gorm:"column:DRRQ"`
	KHMC string    `gorm:"column:KHMC;"`
	YWLX string    `gorm:"column:YWLX;"`
	YWYE float64   `gorm:"column:YWYE"`
	JTBL float64   `gorm:"column:JTBL;"`
	DRJG string    `gorm:"column:DRJG;"`
}

//bwywjzzbAfterImport 导入后执行
func bwywjzzbAfterImport(tx *gorm.DB, params map[string]string) (err error) {
	prams := make([]interface{}, 1)
	prams[0] = params["DRRQ"]
	err = tx.Exec("EXEC UP_COMP_JJZB_BWYW_DTIP ?", prams[0]).Error
	if err != nil {
		return err
	}
	return nil
}

//TableName 国际中收导入表
func (BWYWJZZB) TableName() string {
	return "T_COMP_JZZB_BWYW_DTIP"
}

//BWYWJZZBEF 返回结构体
func BWYWJZZBEF() base.EntityFunc {
	return func() interface{} {
		entity := BWYWJZZB{}
		return &entity
	}
}

//BWYWJZZBESF 返回结构体数组
func BWYWJZZBESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []BWYWJZZB
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("BWYWJZZB", base.NewDefaultDao(BWYWJZZBEF(), BWYWJZZBESF(), nil))
	base.SetAfterCallBack("BWYWJZZB", bwywjzzbAfterImport)

}
